package union

func NewUnion(userId string, unionId int32) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	info, err := logic.NewUnion(userId)
	if err != nil {
		return ret, err
	}
	ret["info"] = info
	return ret, nil
}
func JoinUnion(userId string, unionId int32) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	info, err := logic.JoinUnion(userId, unionId)
	if err != nil {
		return ret, err
	}
	ret["info"] = info
	return ret, nil
}
func UnionInfo(userId string, unionId int32) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	info, err := logic.GetVehicleInfo(unionId)
	if err != nil {
		return ret, err
	}
	ret["info"] = info
	return ret, nil
}
func UnionList(userId string) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	info, err := logic.GetVehicleList(userId)
	if err != nil {
		return ret, err
	}
	ret["list"] = info
	return ret, nil
}
func UpUionLevel(userId string, unionId int32, step int64) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	list, err := logic.UpUnionLevel(userId, unionId, step)
	if err != nil {
		return ret, err
	}
	ret["list"] = list
	return ret, nil

}
func UpUserLevel(userId string, unionId int32, step int64) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	list, err := logic.UpUnionLevel(userId, unionId, step)
	if err != nil {
		return ret, err
	}
	ret["list"] = list
	return ret, nil
}
func BaiFang(userId string, unionId int32, npcId int32) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	list, err := logic.BaiFang(userId, unionId, npcId)
	if err != nil {
		return ret, err
	}
	ret["list"] = list
	return ret, nil
}
func UnionBuild(userId string, bType int) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	ret, err := logic.Build(userId, bType)
	if err != nil {
		return ret, err
	}
	return ret, nil
}
func UnionShopInfo(userId string) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	shopInfo, err := logic.ShopInfo(userId)
	if err != nil {
		return ret, err
	}
	ret["shop_info"] = shopInfo
	return ret, nil
}
func UnionBuildList(userId string) (map[string]interface{}, error) {
	var ret = make(map[string]interface{}, 0)
	logic := NewUnionLogic()
	buildList, err := logic.BuildList(userId)
	if err != nil {
		return ret, err
	}
	ret["build_list"] = buildList
	return ret, nil
}
